package chapter05

/**
 * Created with IntelliJ IDEA.
 * ClassName: Test11_Con
 * Package: chapter05
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 *          Date: 2023-06-20
 *          Time: 17:15
 */

object Test11_Con {
  def main(args: Array[String]): Unit = {
    //1.传值参数
    def f0(a: Int): Unit = {
      println("a: " + a)
    }

    f0(23)

    def f1(): Int = {
      println("f1调用")
      12
    }

    f0(f1())

    println("-------------------")
    //2.传名参数 传递不是具体的值 而是代码块
    def f2(a: => Int): Unit = {
      println("a: " + a)
      println("a: " + a)
    }

    f2(23)
    f2(f1())
    f2({
      println("代码块")
      29
    })


  }
}
